/*
 * CPoisonDeadlyDOT.java
 *
 * Copyright (c) 2009 Giles Millward (Manigra). All rights reserved.
 *
 * This file is part of JRogueDPS.
 *
 * JRogueDPS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JRogueDPS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with JRogueDPS.  If not, see <http://www.gnu.org/licenses/>.
 */

package dpssystem;

import dpsstats.CDamageStats;
import dpsstats.CDeadlyPoisonStats;

/**
 *
 * @author Mani
 */
public class CPoisonDeadlyDOT {

    public int m_stacks;
    double m_endOfDOT;
    double m_vilePoisonBoost;
    CDamageStats m_damageStats;
    CDeadlyPoisonStats m_stackStats;
    

    CPoisonDeadlyDOT(CSim p_sim)
    {
        resetDOT();
        m_damageStats = p_sim.m_stats.m_deadlyPoisonDOTStats;
        m_stackStats = p_sim.m_stats.m_deadlyPoisonStackStats;
        m_vilePoisonBoost = 1.0 + (Math.min(p_sim.m_dpsInterface.m_talents.getVilePoisonsDouble() * 7, 0.2));
    }

    public CEvent refreshDOT(CSim p_sim)
    {
        //p_sim.log("DP Applied " + (Math.min(m_stacks + 1, 5)));
        if (m_stacks == 0)
        {
            // Starting up a DOT
            m_stacks ++;
            m_endOfDOT = p_sim.m_currentRunTime + 12.0;
            return (new CPoisonDeadlyDOTEvent(p_sim.m_currentRunTime + 3.0, this));
        }

        m_endOfDOT = p_sim.m_currentRunTime + 12.0;
        m_stacks = Math.min(m_stacks + 1, 5);
        return null;
    }

    public void resetDOT()
    {
        m_stacks = 0;
        m_endOfDOT = 0.0;
    }

    public boolean hasDebuff()
    {
        return (m_stacks != 0) ? true:false;
    }
}
